home *** CD-ROM | disk | FTP | other *** search
/ Apple Developer Connection Student Program / ADC Tools Sampler CD Disk 3 1999.iso / Metrowerks CodeWarrior / Java Support / Java_Source / Java2 / src / java / awt / ActiveEvent.java next >
Encoding:
Java Source  |  1999-05-28  |  1.8 KB  |  49 lines  |  [TEXT/CWIE]

  1. /*
  2.  * @(#)ActiveEvent.java    1.6 98/09/21
  3.  *
  4.  * Copyright 1997, 1998 by Sun Microsystems, Inc.,
  5.  * 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
  6.  * All rights reserved.
  7.  * 
  8.  * This software is the confidential and proprietary information
  9.  * of Sun Microsystems, Inc. ("Confidential Information").  You
  10.  * shall not disclose such Confidential Information and shall use
  11.  * it only in accordance with the terms of the license agreement
  12.  * you entered into with Sun.
  13.  */
  14.  
  15. package java.awt;
  16.  
  17. /**
  18.  * An interface for events that know how dispatch themselves.
  19.  * By implementing this interface an event can be placed upon the event
  20.  * queue and its <code>dispatch()</code> method will be called when the event
  21.  * is dispatched, using the <code>EventDispatchThread</code>.
  22.  * <p>
  23.  * This is a very useful mechanism for avoiding deadlocks. If
  24.  * a thread is executing in a critical section (i.e., it has entered
  25.  * one or more monitors), calling other synchronized code may
  26.  * cause deadlocks. To avoid the potential deadlocks, an 
  27.  * <code>ActiveEvent</code> can be created to run the second section of
  28.  * code at later time. If there is contention on the monitor,
  29.  * the second thread will simply block until the first thread
  30.  * has finished its work and exited its monitors.
  31.  * <p>
  32.  * For security reasons, it is often desirable to use an <code>ActiveEvent</code> 
  33.  * to avoid calling untrusted code from a critical thread. For
  34.  * instance, peer implementations can use this facility to avoid 
  35.  * making calls into user code from a system thread. Doing so avoids
  36.  * potential deadlocks and denial-of-service attacks.
  37.  *
  38.  * @author  Timothy Prinzing
  39.  * @version 1.6 09/21/98
  40.  */
  41. public interface ActiveEvent {
  42.  
  43.     /**
  44.      * Dispatch the event to it's target, listeners of the events source, 
  45.      * or do whatever it is this event is supposed to do.
  46.      */
  47.     public void dispatch();
  48. }
  49.